# coding: utf-8
from __future__ import unicode_literals

from django.db import models
from datetime import datetime

# Create your models here.


class Banner(models.Model):
		title = models.CharField(max_length=20, verbose_name=u"标题")
		img = models.ImageField(max_length=100, upload_to="static/uploads/banner/%Y/%m", verbose_name=u"banner")
		url = models.URLField(max_length=100, verbose_name=u"跳转地址")
		add_time = models.DateTimeField(default=datetime.now, verbose_name=u"添加时间")

		class Meta:
				verbose_name = u"banner"
				verbose_name_plural = verbose_name


class Health(models.Model):
		title = models.CharField(max_length=20, verbose_name=u"标题")
		img = models.ImageField(upload_to="static/uploads/health/%Y/%m", verbose_name=u"缩略图")
		describe = models.CharField(max_length=300, verbose_name=u"描述")
		content = models.TextField(verbose_name=u"内容")
		auther = models.CharField(max_length=10, verbose_name=u"作者")
		read_num = models.IntegerField(default=230, verbose_name=u"阅读数")
		add_time = models.DateTimeField(default=datetime.now, verbose_name=u"添加时间")

		class Meta:
				verbose_name = u'饮食健康'
				verbose_name_plural = verbose_name


class Link(models.Model):
		name = models.CharField(max_length=50, verbose_name=u"名字")
		url = models.URLField(max_length=200, verbose_name=u"链接地址")
		add_time = models.DateTimeField(default=datetime.now, verbose_name=u"添加时间")

		class Meta:
				verbose_name = u"友情链接"
				verbose_name_plural = verbose_name


class Details(models.Model):
		d_id = models.IntegerField(unique=True, verbose_name=u"菜谱ID")
		class_id = models.IntegerField(verbose_name=u"分类ID")
		name = models.CharField(max_length=60, verbose_name=u"菜名")
		preparetime = models.CharField(max_length=20, verbose_name=u"用餐人数")
		cookingtime = models.CharField(max_length=20, verbose_name=u"烹饪时间")
		content = models.TextField(verbose_name=u"描述")
		pic = models.URLField(verbose_name=u"封面图片")
		tag = models.CharField(max_length=500, verbose_name=u"标签")
		material = models.TextField(verbose_name=u"材料")
		process = models.TextField(verbose_name=u"步骤")
		add_time = models.DateTimeField(default=datetime.now, verbose_name=u"添加时间")

		class Meta:
				verbose_name = u"菜谱详情"
				verbose_name_plural = verbose_name


class Nums(models.Model):
		num = models.IntegerField(unique=True, verbose_name=u"首页推荐显示")
		add_time = models.DateTimeField(default=datetime.now, verbose_name=u"添加时间")

		class Meta:
				verbose_name = u"推荐显示"
				verbose_name_plural = verbose_name
